import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooVmcController } from '../../../controllers';
const uctoovmcRouter = new Router();
const vmcController = new uctooVmcController();

uctoovmcRouter.post('/add', requireUser, vmcController.add);
uctoovmcRouter.post('/edit', requireUser, rowLevelPermission('uctoo/vmc'), vmcController.edit);
uctoovmcRouter.post('/del', requireUser, rowLevelPermission('uctoo/vmc'), vmcController.delete);

//For getting vmc with permission control
uctoovmcRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/vmc'), vmcController.getSingle);
uctoovmcRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/vmc'), vmcController.getMany);
uctoovmcRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/vmc'), vmcController.getMany);

//#endregion AutoCreateCode
uctoovmcRouter.post('/wechatopenCreateQRCode', requireUser, vmcController.wechatopenCreateQRCode);
uctoovmcRouter.post('/createQRCode', requireUser, vmcController.createQRCode);
uctoovmcRouter.post('/wechatopenCreateLoginQRCode', vmcController.wechatopenCreateLoginQRCode);
export default uctoovmcRouter;
